

#pragma once
#include "Vector3.h"

class Matrix3
{
public:
	
	float mt[3][3];
	Matrix3();
	Matrix3(float m00, float m01, float m02,
			float m10, float m11, float m12,
			float m20, float m21, float m22);
	
	/// casting from a vector3f to a matrix is the tilde operator
	Matrix3(const Vector3 &v);


	/// constructor "="
	Matrix3 &operator=(const Matrix3 &mat);

	/// multiplication by a matrix
	Matrix3 &operator *=(const Matrix3 &m);

	/// multiplication by a vector
	Vector3 operator *(const Vector3 &v) const;		

	/// multiplication by a scalar
	Matrix3 &operator *=(const float s);

	/// division by a scalar
	Matrix3 &operator /=(const float s);

	/// addition	
	Matrix3 operator +(const Matrix3 &m) const;	

	/// addition
	Matrix3 &operator +=(const Matrix3 &m);

	/// subtraction	
	Matrix3 operator -(const Matrix3 &m) const;

	/// subtraction
	Matrix3 &operator -=(const Matrix3 &m);

	// set matrix vars
	void setMatrix3(float m00, float m01, float m02,
		float m10, float m11, float m12,
		float m20, float m21, float m22);
	/// computing the determinant
	float determinant() const;

	/// an x axis rotation matrix
	static void rotate_X(Matrix3 &m, const float angle);

	/// construct an y axis rotation matrix
	static void rotate_Y(Matrix3 &m, const float angle);

	/// construct an z axis rotation matrix
	static void rotate_Z(Matrix3 &m, float angle);

	/// constructs a rotation matrix around an arbitrary vector
	static void rotate(Matrix3 &m, const Vector3 &v, const float angle);

	/// sets a rotation matrix up by euler angles
	/// uses pitch, roll, yaw (xyz) form
	static void rotate_Euler(Matrix3 &m, float x, float y, float z);

	/// sets a rotation matrix up by euler angles
	/// uses pitch, roll, yaw (xyz) form
	static void rotate_Euler(Matrix3 &m, const Vector3 &angles);

	static Vector3 &multiply_Vector3Matrix3(Vector3 &vecdesc,const Vector3 &vecsrc,const Matrix3 &mat);

};
